import axios from 'axios'

const baseURL = 'http://www.lovegf.cn:8899/api'
axios.defaults.baseURL = baseURL

// 请求首页轮播图
export const getnaber = params => {
    return axios.get('getlunbo').then(res => res.data)
}
// 首页点击的新闻资讯区域 
export const getnewslists = params => {
    return axios.get('getnewslist').then(res => res.data)
}
// 获取图文资讯详情
export const getnew = params => {
   return axios.get(`getnew/${params}`).then(res => res.data)
}
// 添加新闻品论组件  /getcomments/:artid?pageindex=1 发 
export const addcomment = (params,page) => {
    return axios.get(`/getcomments/${params}?pageindex=${page}`).then(res => res.data)
  }
//   提交新闻评论信息  /api/postcomment/:artid
export const addlist = (params,obj) => {    //前面的是请求头   后面的是请求报文
    return axios.post(`postcomment/${params}`,obj).then(res => res.data)
 }

// 图片分类数据
export const getimg = params => {
    return axios.get(`getimgcategory`).then(res => res.data)
 }
//  图片列表数据
export const getlistimg = params => {
    return axios.get(`getimages/${params}`).then(res => res.data)
 }

 // 商品信息列表
export const addgoodlist = params => {
    return axios.get(`getgoods?pageindex=${params}`).then(res => res.data)
  }
// 商品详情伊尔页面轮播图
export const addgoodbannder = params => {
    return axios.get(`getthumimages/${params}`).then(res => res.data)
  }
 // 获取商品参数区和价格，标题等数据
export const getgoodlist = params => {
    return axios.get(`goods/getinfo/${params}`).then(res => res.data)
  }
//  商品图文介绍   
export const goodlist = params => {
    return axios.get(`goods/getdesc/${params}`).then(res => res.data)
  }